package com.ruanyun.modular.admin.mapper;

import com.ruanyun.modular.admin.entity.TProductionProcess;
import com.ruanyun.modular.admin.entity.TProposedMeasuresPlan;
import com.ruanyun.modular.admin.model.params.TMeasuresParam;
import com.ruanyun.modular.admin.model.params.TProposedMeasuresPlanParam;
import com.ruanyun.modular.admin.model.params.VocManagementLedgerParam;
import com.ruanyun.modular.admin.model.result.TMeasuresResult;
import com.ruanyun.modular.admin.model.result.TProposedMeasuresPlanResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruanyun.modular.admin.model.result.TProposedMeasuresPlanResults;
import com.ruanyun.modular.admin.model.result.VocManagementLedgerResult;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 拟实施措施计划 Mapper 接口
 * </p>
 *
 * @author zs
 * @since 2021-04-19
 */
@Repository
public interface TProposedMeasuresPlanMapper extends BaseMapper<TProposedMeasuresPlan> {

    /**
     * 获取列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    List<TProposedMeasuresPlanResult> customList(@Param("paramCondition") TProposedMeasuresPlanParam paramCondition);

    /**
     * 获取map列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") TProposedMeasuresPlanParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    Page<TProposedMeasuresPlanResult> customPageList(@Param("page") Page page, @Param("paramCondition") TProposedMeasuresPlanParam paramCondition);

    Page<TProposedMeasuresPlanResult> customPageList1(@Param("page") Page page, @Param("paramCondition") TProposedMeasuresPlanParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author zs
     * @Date 2021-04-19
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") TProposedMeasuresPlanParam paramCondition);

    /*根据companyId 查询是否存在数据*/
    @Select("SELECT * FROM t_proposed_measures_plan WHERE company_id = #{companyId}  and del_flag != 2 ")
    List<TProposedMeasuresPlan> getDetails(@Param("companyId") Long companyId);




    TProposedMeasuresPlanResult getPlanDetail(@Param("companyId")Long companyId);


     @Select("select * from t_proposed_measures_plan where id = #{id}")
     TProposedMeasuresPlanResults getDetail(@Param("id") Integer id);


    Page<TProposedMeasuresPlanResult>  getProposedMeasuresPlanPage(@Param("pageContext") Page pageContext, @Param("companyId") Integer companyId);


    Page<TMeasuresResult> getVocsPage(@Param("page") Page page, @Param("rid") Integer rid);




    Page<VocManagementLedgerResult> getLedgerPage(@Param("page") Page page, @Param("companyId") Integer companyId);



    Page<TProposedMeasuresPlanResult> customPageList2(@Param("page") Page page, @Param("paramCondition") TProposedMeasuresPlanParam paramCondition);





}
